package cn.b.sky.mes.hr.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.b.sky.mes.hr.dao.ShiftingPermissionDao;
import cn.b.sky.mes.hr.model.ShiftingPermission;
import cn.b.sky.mes.hr.model.condition.ShiftingPermissionCondition;
import cn.b.sky.mes.hr.service.ShiftingPermissionService;

@Service
public class ShiftingPermissionServiceImpl implements ShiftingPermissionService {
  @Autowired
  private ShiftingPermissionDao shiftingPermissionDao;

  @Override
  public List<ShiftingPermission> getShiftingPermissionsListByCondition(ShiftingPermissionCondition condition) {
    return shiftingPermissionDao.getShiftingPermissionsListByCondition(condition);
  }

  @Override
  public int getShiftingPermissionsCountByCondition(ShiftingPermissionCondition condition) {
    return shiftingPermissionDao.getShiftingPermissionsCountByCondition(condition);
  }

  @Override
  public List<ShiftingPermission> getPermissionsByWorkcenter(String siteCode, String workcenterCode, Integer lockFlag) {
    return shiftingPermissionDao.getPermissionsByWorkcenter(siteCode, workcenterCode, lockFlag);
  }

  @Override
  public List<ShiftingPermission> getPermissionsByUser(String siteCode, String userCode, Integer lockFlag) {
    return shiftingPermissionDao.getPermissionsByUser(siteCode, userCode, lockFlag);
  }

  @Override
  public ShiftingPermission getPermissionsByWorkcenterAndUser(String siteCode, String workcenterCode, String userCode,
      Integer lockFlag) {
    return shiftingPermissionDao.getPermissionsByWorkcenterAndUser(siteCode, workcenterCode, userCode, lockFlag);
  }

  @Override
  public void insertShiftingPermission(ShiftingPermission shiftingPermission) {
    shiftingPermissionDao.insertShiftingPermission(shiftingPermission);
  }

  @Override
  public void deleteShiftingPermission(ShiftingPermission shiftingPermission) {
    shiftingPermissionDao.deleteShiftingPermission(shiftingPermission);
  }

}
